home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 52 / Amiga Format AFCD52 (Issue 136, May 2000).iso / -serious- / programming / basic / hotshotssrc / hotshots.ascii next >
Text File  |  2000-02-23  |  55KB  |  2,260 lines

  1. WBStartup
  2. #TESTING=1 ; 1 for development, 0 for finished compile
  3. If ChipFree<350000
  4.   If FromCLI
  5.     NPrint " Failure : Not enough memory"
  6.     NPrint " Please free some and try again"
  7.     CNIF #TESTING=1
  8.       NPrint "Press mouse to end"
  9.       Repeat
  10.         VWait 10
  11.       Until Joyb(0)<>0
  12.     CEND
  13.   Else
  14.     WbToScreen 0
  15.     ShowScreen 0
  16.     Window 0,70,40,316,46,$100e,"HotShots by Chris Nash",0,1
  17.     NPrint ""
  18.     NPrint "      Failure : Not enough memory"
  19.     NPrint "    Please free some and try again"
  20.     Repeat
  21.       ev.l=WaitEvent
  22.     Until ev=$200
  23.   EndIf
  24.   End
  25. EndIf
  26.  
  27. If NOT Exists("HSDaa")
  28.   If FromCLI
  29.     NPrint " I cannot find the HotShots data drawer!"
  30.     NPrint " You need to set the current directory"
  31.     NPrint " to the path which contains this drawer."
  32.     CNIF #TESTING=1
  33.       NPrint "Press mouse to end"
  34.       Repeat
  35.         VWait 10
  36.       Until Joyb(0)<>0
  37.     CEND
  38.   Else
  39.     WbToScreen 0
  40.     ShowScreen 0
  41.     Window 0,30,40,360,54,$100e,"HotShots by Chris Nash",0,1
  42.     NPrint ""
  43.     NPrint "  I cannot find the HotShots data drawer!"
  44.     NPrint "  You need to set the current directory"
  45.     NPrint "  to the path which contains this drawer."
  46.     Repeat
  47.       ev.l=WaitEvent
  48.     Until ev=$200
  49.   EndIf
  50.   End
  51. EndIf
  52.  
  53. BLITZ
  54.  
  55. NEWTYPE .spring
  56.   x.q : y     ; spring coordinate
  57.   f           ; spring frame for springing
  58. End NEWTYPE
  59. Dim top.spring(14)
  60. Restore topspring
  61. For ts=0 To 13
  62.   Read top(ts)\x
  63.   top(ts)\y=18
  64.   top(ts)\f=1
  65. Next ts
  66. NEWTYPE .character
  67.   x.q : y          ; player coordinates
  68.   xt : yt          ; top shape offset
  69.   tpoint           ; rotation frame number
  70.   tstill           ; top still shape
  71.   tshape           ; top shape number
  72.   tfirst           ; first shape of rotation
  73.   tlast            ; last shape of rotation
  74.  
  75.   suck             ; suction state
  76.                    ; true or false
  77.   stuck            ; if ball is stuck to gun
  78.                    ; true or false
  79.  
  80.   xb : yb          ; bottom shape offset
  81.   bstill           ; bottom still shape
  82.   bshape           ; bottom shape number
  83.   bfirstr          ; first shape of running right
  84.   blastr           ; last shape of running right
  85.   bfirstl          ; first shape of running left
  86.   blastl           ; last shape of running left
  87.  
  88.   movspd           ; movement speed
  89.  
  90.   char             ; character number
  91.   brain            ; whos in control
  92.                    ; true=human , false=computer
  93. End NEWTYPE
  94. NEWTYPE .position : x.q : y : End NEWTYPE
  95. NEWTYPE .type
  96.   joy.q           ; true=joystick, false=keyboard
  97.   left            ; keys used if control
  98.   right           ; is not a joystick
  99.   fire            ; ie $45 is escape
  100. End NEWTYPE
  101. Dim guy.character(2)
  102. Dim control.type(2)           ; player keys
  103. Dim gun.position(2,16)        ; gun offset
  104. Dim gridblock(2,7,7)
  105. Dim numblocks(2)
  106. NEWTYPE .player : score.l : water.q : stam.q : heat.q : End NEWTYPE
  107. Dim stats.player(2)
  108. Dim sou(10)    ; for the different samples
  109. Dim chan(4)    ; see if sound channel was recently used
  110. NEWTYPE .movers : x.q : y : xs : ys : xa : ya : f : End NEWTYPE
  111. Dim hotshot.movers(2)
  112. Dim fkey.movers(10)
  113.  
  114. control(0)\left=$31
  115. control(0)\right=$32
  116. control(0)\fire=$64
  117. control(1)\left=$4f
  118. control(1)\right=$4e
  119. control(1)\fire=$65
  120.  
  121. bx=148 : by=194
  122. bxs=0 : bys=0
  123. bison=False
  124. maxspeed=5
  125. blockbounce=maxspeed+3
  126. air=3
  127. pluny=187
  128. plunhit=23
  129.  
  130. pause=$5f
  131. haspaused=False
  132. escape=$45
  133. chleft=$38
  134. chright=$39
  135. chup=$2a
  136. chdown=$3a
  137.  
  138. CNIF #TESTING=0
  139.   SetErr
  140.     End
  141.   End SetErr
  142. CEND
  143.  
  144. Function .q Angle{x1.q, y1.q, x2.q, y2.q}
  145.   deg.q=(ASin((x1-x2)/320)/Pi)*180
  146.  
  147.   If y1<y2
  148.     deg=180-deg
  149.   Else
  150.     If x1<x2
  151.       deg=360-deg
  152.     EndIf
  153.   EndIf
  154.  
  155.   Function Return deg
  156. End Function
  157.  
  158. Gosub getoptions
  159.  
  160. QAMIGA
  161. If logo
  162.   LoadAnim 0,"HSDaa/calm",0
  163.   LoadSound 0,"HSDaa/drum"
  164.   LoadSound 1,"HSDaa/orch"
  165.   InitPalette 2,8
  166.   FadePalette 0,2,0.4
  167.   FadePalette 2,0,1
  168. EndIf
  169.  
  170. ;Delay_(2000)
  171. BLITZ
  172. BitMap 4,320,256,4
  173. BitMap 5,320,256,4
  174.  
  175. BlitzKeys On : BlitzRepeat 0,0
  176. Mouse On : MouseArea 0,0,320,256
  177. InitCopList 0,44,256,$4,8,16,-2
  178. DisplayBitMap 0,4
  179. CreateDisplay 0
  180. Use BitMap 4
  181. db=4
  182.  
  183. .logo
  184. If logo
  185.   DisplayPalette 0,0
  186.   InitAnim 0,5
  187.   current=0 : animover=False
  188.   VWait 50
  189.   Repeat
  190.     DisplayBitMap 0,db
  191.     VWait
  192.     db=9-db
  193.     Use BitMap db
  194.     NextFrame 0
  195.     current+1
  196.     If current=7 : Sound 0,%1100,64,48 : VWait 10 : EndIf
  197.     If current=14 : Sound 0,%0011,48,64 : VWait 10 : EndIf
  198.     If current=19 : Sound 0,%1100,64,48 : VWait 10 : EndIf
  199.     If current=24 : Sound 0,%0011,48,64 : VWait 10 : EndIf
  200.     If current=29 : Sound 0,%1111 : animover=True : EndIf
  201.     If Joyb(0)>0 OR Joyb(1)>0 OR Inkey$<>"" Then Goto calmover
  202.   Until animover
  203.   VWait 30
  204.   For count=1 To 2.5 Step 0.25
  205.     FadePalette 2,0,count
  206.     DisplayPalette 0,0
  207.     If count=2 Then Sound 1,%1111
  208.     VWait
  209.   Next count
  210.   VWait 70
  211.   calmover:
  212.   pal=0 : Gosub fadeitout
  213.   Free Sound 0
  214.   Free Sound 1
  215.   Free Anim 0
  216.   Free Palette 2
  217. EndIf
  218.  
  219. BitMap 1,320,256,1
  220. BitMap 2,320,256,1
  221. BitMap 0,320,256,4
  222. BitMap 7,320,256,4
  223.  
  224. Buffer 0,1024 : Buffer 4,1024
  225. Buffer 1,2048 : Buffer 5,2048
  226. Buffer 3,8192 : Buffer 6,8192
  227. Buffer 2,1024 : Buffer 7,1024
  228. Queue 0,1
  229.  
  230. QAMIGA
  231. LoadShapes 1,"HSDaa/objects"
  232.  
  233. For count=33 To 80
  234.   Free Shape count
  235. Next count
  236. For count=100 To 120
  237.   Free Shape count
  238. Next count
  239. For count=135 To 155
  240.   Free Shape count
  241. Next count
  242.  
  243. LoadSound 0,"HSDaa/bounce"
  244. LoadSound 1,"HSDaa/side&top"
  245. LoadSound 2,"HSDaa/plunger"
  246. LoadSound 3,"HSDaa/block"
  247.  
  248. ;Delay_(2000)
  249. BLITZ
  250. ;CopyShape 326,231
  251. CopyShape 328,231
  252. CopyShape 327,232
  253.  
  254. If title Then Gosub titlescreen
  255. Gosub optionscreen
  256.  
  257. guy(0)\char=1
  258. guy(1)\char=2
  259. Gosub getguybits
  260. Dim tls(2)
  261. tls(0)=-1 : tls(1)=-1
  262.  
  263. Gosub setfirstgame
  264. Gosub main
  265. Goto quit
  266.  
  267. .main
  268.   Gosub setlevel
  269.   BitMap 3,320,256,1 : Cls 0
  270.   Gosub setblocks
  271.   DisplayBitMap 0,0
  272.   DisplayPalette 0,0
  273.   Gosub initrain
  274.   Repeat
  275.     tim=QWrap(tim+1,1,9)
  276.     time-1
  277.     If time<0 Then Goto quit
  278.     ;If time<0 : Stop : Goto quit : EndIf
  279.  
  280.     If bison=False AND bfra=-1 Then bfra=0
  281.     If bfra<>-1
  282.       Gosub shootball
  283.       bfra+1
  284.     EndIf
  285.     For maincount=0 To 1
  286.       If guy(maincount)\brain=True
  287.         jo=1-maincount
  288.         If control(maincount)\joy=True Then Gosub readjoy Else Gosub readkey
  289.       EndIf
  290.       If guy(maincount)\brain=False AND (tim=1 OR tim=3 OR tim=5 OR tim=7) Then Gosub amigaintelligence
  291.       If tim=3 OR tim=4 OR tim=7 OR tim=8
  292.         USEPATH guy(maincount)
  293.         If \stuck=False AND \suck=True Then Gosub computesuck
  294.       EndIf
  295.       If guy(maincount)\stuck=True Then Gosub computestuck
  296.     Next maincount
  297.     If guy(0)\stuck=False AND guy(1)\stuck=False
  298.       If shootout=-1 Then Gosub computeobjects
  299.       If by>28 AND by<110 AND (bx<140 OR bx>180) Then Gosub blocks
  300.       If bison=True Then Gosub computeball
  301.     EndIf
  302.     Gosub sounds
  303.     Gosub computeguys
  304.     If magnet Then Gosub computemagnet
  305.     If tim=3 AND (tls(0)<>stats(0)\score OR tls(1)<>stats(1)\score)
  306.       Gosub drawscore
  307.       tls(0)=stats(0)\score
  308.       tls(1)=stats(1)\score
  309.     EndIf
  310.     Gosub television
  311.     Gosub blitall
  312.     If tim=1 OR tim=4 Then Gosub goodies
  313.     Gosub hitgoodies
  314.     If NOT RawStatus(pause) Then haspaused=False
  315.     If RawStatus(pause) AND haspaused=False
  316.       haspaused=True
  317.       Repeat : Until NOT RawStatus(pause)
  318.       Repeat : Until RawStatus(pause) OR RawStatus(escape)
  319.     EndIf
  320.     If RawStatus(escape) Then wannaquit=True
  321.   ;  MOVE.w -1,$dff180
  322.   Until wannaquit
  323.   For count=0 To 4
  324.     Free BitMap count
  325.   Next
  326. Return
  327.  
  328. .quit
  329.   End
  330. Return
  331.  
  332. .setlevel
  333.   QAMIGA
  334.   Select level
  335.     Case 1
  336.       LoadBitMap 1,"HSDaa/mainx"
  337.       LoadBitMap 2,"HSDaa/mainy"
  338.       LoadBitMap 0,"HSDaa/main",0
  339.       CopyBitMap 0,4
  340.   End Select
  341.   BLITZ
  342. Return
  343.  
  344. .setfirstgame
  345.   stats(0)\score=0
  346.   stats(1)\score=0
  347.   stats(0)\water=0
  348.   stats(1)\water=0
  349.   stats(0)\stam=51
  350.   stats(1)\stam=51
  351.   stats(0)\heat=17
  352.   stats(1)\heat=17
  353.  
  354.   tim=0 : db=0 : bdb=2
  355.   bfra=-1 : shootout=3
  356.   gogood=-1 : stopgood=-1
  357.   goodon=-1 : curgood=0
  358.   hitgood=False : goodcount=-1
  359.   time=4000
  360.   lasthad=-1
  361.   magx=160 : magy=70
  362.   magxs=0 : magys=0
  363.   magnet=False
  364.   ying=False
  365.   tv=0 : tvframe=384 : tvtime=-1
  366.   manwait=300 : lastman=1
  367.   wannaquit=False
  368.   level=1
  369. Return
  370.  
  371. .television
  372.   ; tv:  0=whitenoise (qushhchhshh)
  373.   ;      1=get ready
  374.   ;      2=great shot
  375.   ;      3=dead in water
  376.   ;      4=player 1 wins
  377.   ;      5=player 2 wins
  378.   ;      6=extra time
  379.   ;      7=magnet
  380.   ;      8=score
  381.   ;      9=swap sides
  382.   ;     10=blank
  383.   ;     11=man
  384.  
  385.   If tvtime<>-1
  386.     tvtime-1
  387.     If tvtime=0
  388.       tv=0
  389.       tvtime=-1
  390.       tvframe=391
  391.     EndIf
  392.   EndIf
  393.   If tv=0 Then manwait-1
  394.   If tv<>0 AND tv<>10 AND tv<>11 Then manwait=300
  395.   If manwait<0 : manwait=0 : tv=11 : tvtime=400 : lastman=1 : EndIf
  396.   If tv=11
  397.     Select lastman
  398.       Case 1
  399.         Select tvtime
  400.           Case 400 : tvframe=341
  401.           Case 350
  402.             Select QWrap(Int(Rnd(9)),0,8)
  403.               Case 0 : lastman=2
  404.               Case 1 : lastman=2  ; talk
  405.               Case 2 : lastman=2
  406.               Case 3 : lastman=3  ; look left
  407.               Case 4 : lastman=4  ; look right
  408.               Case 5 : lastman=5  ; look up
  409.               Case 6 : lastman=6  ; look down
  410.             End Select
  411.           Case 300 : tvtime=50
  412.           Case 10 : tv=0 : tvframe=389 : manwait=300
  413.         End Select
  414.       Case 2
  415.         Select tvtime
  416.           Case 340 : tvframe=342
  417.           Case 330 : tvframe=341
  418.           Case 320 : tvframe=342
  419.           Case 310 : tvframe=341
  420.           Case 290 : lastman=1
  421.         End Select
  422.       Case 3
  423.         Select tvtime
  424.           Case 300 : tvframe=343
  425.           Case 200 : tvframe=341 : lastman=1
  426.         End Select
  427.       Case 4
  428.         Select tvtime
  429.           Case 300 : tvframe=344
  430.           Case 200 : tvframe=341 : lastman=1
  431.         End Select
  432.       Case 5
  433.         Select tvtime
  434.           Case 300 : tvframe=345
  435.           Case 230 : tvframe=341 : lastman=1
  436.         End Select
  437.       Case 6
  438.         Select tvtime
  439.           Case 300 : tvframe=346
  440.           Case 150 : tvframe=341 : lastman=1
  441.         End Select
  442.     End Select
  443.   EndIf
  444.   If tv=0 Then tvframe=QWrap(tvframe+1,384,392)
  445.   If tim=1 OR tim=4
  446.     Select tv
  447.       Case 1  : tvframe=QWrap(tvframe+1,350,352)
  448.       Case 2  : tvframe=QWrap(tvframe+1,352,354)
  449.       Case 3  : tvframe=QWrap(tvframe+1,354,360)
  450.       Case 4  : tvframe=QWrap(tvframe+1,360,368)
  451.       Case 5  : tvframe=QWrap(tvframe+1,368,376)
  452.       Case 6  : tvframe=QWrap(tvframe+1,376,384)
  453.       Case 7  : tvframe=QWrap(tvframe+1,393,396)
  454.       Case 8  : tvframe=QWrap(tvframe+1,396,398)
  455.       Case 9  : tvframe=QWrap(tvframe+1,398,400)
  456.       Case 10 : tvframe=392
  457.     End Select
  458.   EndIf
  459. Return
  460.  
  461. .goodies
  462.   If ((stats(0)\score+stats(1)\score)-(p1s+p2s)>3) AND gogood=-1 AND goodon=-1 AND hitgood=False Then gogood=0
  463.   If gogood<>-1
  464.     gogood+1
  465.     If gogood>3
  466.       gogood=-1
  467.       goodon=400
  468.       Repeat
  469.         curgood=Int(Rnd(8))
  470.       Until curgood=0 OR (curgood>3 AND curgood<7)
  471.     EndIf
  472.   EndIf
  473.   If goodon<>-1
  474.     goodon-4
  475.     If goodon<0
  476.       stopgood=3
  477.       goodon=-1
  478.     EndIf
  479.   EndIf
  480.   If stopgood<>-1
  481.     stopgood-1
  482.     If stopgood<0 Then stopgood=-1
  483.   EndIf
  484.   p1s=stats(0)\score
  485.   p2s=stats(1)\score
  486. Return
  487.  
  488. .hitgoodies
  489.   Use BitMap db
  490.   If goodon<>-1 AND ShapesHit(231,bx,by,431+curgood,160,70)
  491.     goodon=-1
  492.     hitgood=True
  493.     goodcount=0
  494.   EndIf
  495.   If stopgood<>-1 AND ShapesHit(231,bx,by,410+stopgood,160,70)
  496.     stopgood=-1
  497.     hitgood=True
  498.     goodcount=0
  499.   EndIf
  500.   If hitgood=True
  501.     goodcount+1
  502.     Select curgood
  503.       Case 0   ; clock
  504.         If goodcount=1
  505.           time+750
  506.           tv=6 : tvtime=200
  507.           tvframe=376
  508.         EndIf
  509.         If goodcount>200
  510.           hitgood=False
  511.           goodcount=-1
  512.         EndIf
  513.       Case 4   ; magnet
  514.         If goodcount=1
  515.           magx=160 : magy=130
  516.           magxs=QWrap(Rnd(3),1.4,2.2) : magys=QWrap(Rnd(3),1.0,1.8)
  517.           magnet=True
  518.           tv=7 : tvtime=300
  519.           tvframe=393
  520.         EndIf
  521.         If goodcount>1500
  522.           hitgood=False
  523.           goodcount=-1
  524.           magnet=False
  525.         EndIf
  526.       Case 5   ; score
  527.         If goodcount=1 AND lasthad=-1
  528.           tv=10 : tvtime=150
  529.           tvframe=392
  530.         EndIf
  531.         If goodcount=1 AND lasthad>-1
  532.           stats(lasthad)\score+30
  533.           tv=8 : tvtime=300
  534.           tvframe=396
  535.         EndIf
  536.         If goodcount>200
  537.           hitgood=False
  538.           goodcount=-1
  539.         EndIf
  540.       Case 6   ; swap sides
  541.         If goodcount=1
  542.           ying=True
  543.           tv=9 : tvtime=300
  544.           tvframe=398
  545.         EndIf
  546.         If goodcount>800
  547.           hitgood=False
  548.           goodcount=-1
  549.           ying=False
  550.         EndIf
  551.     End Select
  552.   EndIf
  553. Return
  554.  
  555. .computemagnet
  556.   If bx<magx Then bxs+0.25
  557.   If bx<magx-40 Then bxs-0.125
  558.   If bx>magx Then bxs-0.25
  559.   If bx>magx+40 Then bxs+0.125
  560.  
  561.   If by<magy Then bys+0.25
  562.   If by<magy-30 Then bys-0.125
  563.   If by>magy Then bys-0.25
  564.   If by>magy+30 Then bys+0.125
  565.  
  566.   Use BitMap 1
  567.   If BlitColl(249,magx,magy)
  568.     magxs=-magxs
  569.     magx+(magxs*2.5)
  570.   EndIf
  571.   magx+magxs
  572.  
  573.   Use BitMap 2
  574.   If BlitColl(249,magx,magy)
  575.     magys=-magys
  576.     magy+(magys*1.66)
  577.   EndIf
  578.   If magy<100 AND magys<0 Then magys=-magys
  579.   magy+magys
  580. Return
  581.  
  582. .amigaintelligence
  583.   If ying Then temp=1-maincount Else temp=maincount
  584.   USEPATH guy(temp)
  585.  
  586.   If bx>bxoveride-10 AND bx<bxoveride+10 AND by>byoveride-20 AND by<byoveride+20
  587.     overidewait+1
  588.     If overidewait>200
  589.       giveoveride+10
  590.       If giveoveride>100 Then giveoveride=50
  591.     EndIf
  592.   Else
  593.     overidewait=0
  594.     giveoveride-1
  595.   EndIf
  596.   giveoveride-1 : If giveoveride<0 Then giveoveride=0
  597.   bxoveride=bx : byoveride=by
  598.  
  599.   If \stuck=False
  600.     If \suck=True
  601.       If Int(Rnd(4))=1 Then \suck=False
  602.     Else
  603.       If Int(Rnd(4))=1 Then \suck=True
  604.     EndIf
  605.     If Sqr(((bx-\x)*(bx-\x))+((by-\y)*(by-\y)))<80 OR giveoveride<>0
  606.       degree=(Angle{\x,\y,bx,by}*360)+90
  607.       If degree>348.8 Then degree-360
  608.       degree=Int(degree/22.5)+1
  609.       If \tpoint<>degree
  610.         If \tpoint<=5 AND degree>=13 Then degree-17
  611.         If \tpoint>=13 AND degree<=5 Then degree+16
  612.         If degree>\tpoint
  613.           \tshape+1
  614.           \tpoint+1
  615.         EndIf
  616.         If degree<\tpoint
  617.           \tshape-1
  618.           \tpoint-1
  619.         EndIf
  620.       EndIf
  621.     EndIf
  622.   Else
  623.     lasthad=temp
  624.     If \tpoint>=13 OR \tpoint<=5
  625.       If Int(Rnd(9))=1 Then \suck=False
  626.       If Int(Rnd(4))=1 AND (\tpoint>=16 OR \tpoint<=2) Then \suck=False
  627.       If Int(Rnd(2))=1 AND stats(temp)\heat<2 Then \suck=False
  628.     EndIf
  629.     If \tpoint>=9 AND \tpoint<16
  630.       \tshape+1 : \tpoint+1
  631.     EndIf
  632.     If \tpoint<9 AND \tpoint>2
  633.       \tshape-1 : \tpoint-1
  634.     EndIf
  635.     If \tpoint=oldtpoint OR \tpoint=oldoldtpoint OR (\tpoint>9 AND Int(Rnd(8))=1)
  636.       \tshape+1 : \tpoint+1
  637.       Goto done
  638.     EndIf
  639.     If \tpoint=oldtpoint OR \tpoint=oldoldtpoint OR (\tpoint<=9 AND Int(Rnd(8))=1)
  640.       \tshape-1 : \tpoint-1
  641.     EndIf
  642.     done:
  643.   EndIf
  644.   oldoldtpoint=oldtpoint
  645.   oldtpoint=\tpoint
  646.   If \tshape>\tlast
  647.     \tshape=\tfirst
  648.     \tpoint=1
  649.   EndIf
  650.   If \tshape<\tfirst
  651.     \tshape=\tlast
  652.     \tpoint=16
  653.   EndIf
  654.   If \suck=False
  655.     \stuck=False
  656.     If Int(Rnd(2))=1
  657.       If bx>\x
  658.         \x+\movspd
  659.         If (\bshape=\bstill)OR(\bshape>=\bfirstl AND \bshape<=\blastl) Then \bshape=\blastr
  660.         \bshape+1
  661.         If \bshape>\blastr Then \bshape=\bfirstr
  662.       EndIf
  663.       If bx<\x
  664.         \x-\movspd
  665.         If (\bshape=\bstill)OR(\bshape>=\bfirstr AND \bshape<=\blastr) Then \bshape=\blastl
  666.         \bshape+1
  667.         If \bshape>\blastl Then \bshape=\bfirstl
  668.       EndIf
  669.     EndIf
  670.   Else
  671.     \bshape=\bstill
  672.   EndIf
  673. Return
  674.  
  675. .shootball
  676.     ; 1 = left
  677.     ; 2 = right
  678.     ; 3 = top
  679.  
  680.   Select shootout
  681.     Case 1
  682.       If bfra>=0 AND bfra<=10
  683.           bx=10 : by=199
  684.           bxs=0 : bys=0
  685.       EndIf
  686.       Select bfra
  687.         Case 11 : bx=10 : by=193
  688.         Case 12 : bx=10 : by=188
  689.         Case 13 : bx=10 : by=183
  690.         Case 14 : bx=10 : by=178
  691.         Case 15 : bx=10 : by=173
  692.           Use BitMap db
  693.           Blit 240,17,156
  694.           Use BitMap 4-db
  695.           Blit 240,17,156
  696.         Case 16 : bx=10 : by=168
  697.           Use BitMap db
  698.           Blit 241,17,156
  699.           Use BitMap 4-db
  700.           Blit 241,17,156
  701.         Case 17 : bx=10 : by=163
  702.           Use BitMap db
  703.           Blit 242,17,156
  704.           Use BitMap 4-db
  705.           Blit 242,17,156
  706.         Case 18 : bx=10 : by=158
  707.         Case 19 : bx=10 : by=153
  708.         Case 20 : bx=12 : by=149
  709.         Case 21 : bx=17 : by=144
  710.         Case 22 : bx=22 : by=139
  711.           bxs=5 : bys=-5
  712.           bison=True
  713.         Case 33
  714.           Use BitMap db
  715.           Blit 241,17,156
  716.           Use BitMap 4-db
  717.           Blit 241,17,156
  718.         Case 34
  719.           Use BitMap db
  720.           Blit 240,17,156
  721.           Use BitMap 4-db
  722.           Blit 240,17,156
  723.           bfra=-2 : shootout=-1
  724.       End Select
  725.     Case 2
  726.       Select bfra
  727.         Case 0
  728.           bx=309 : by=199
  729.           bxs=0 : bys=0
  730.         Case 11 : bx=309 : by=193
  731.         Case 12 : bx=309 : by=188
  732.         Case 13 : bx=309 : by=183
  733.         Case 14 : bx=309 : by=178
  734.         Case 15 : bx=309 : by=173
  735.           Use BitMap db
  736.           Blit 243,303,156
  737.           Use BitMap 4-db
  738.           Blit 243,303,156
  739.         Case 16 : bx=309 : by=168
  740.           Use BitMap db
  741.           Blit 244,303,156
  742.           Use BitMap 4-db
  743.           Blit 244,303,156
  744.         Case 17 : bx=309 : by=163
  745.           Use BitMap db
  746.           Blit 245,303,156
  747.           Use BitMap 4-db
  748.           Blit 245,303,156
  749.         Case 18 : bx=309 : by=158
  750.         Case 19 : bx=309 : by=153
  751.         Case 20 : bx=307 : by=149
  752.         Case 21 : bx=302 : by=144
  753.         Case 22 : bx=297 : by=139
  754.           bxs=-5 : bys=-5
  755.           bison=True
  756.         Case 33
  757.           Use BitMap db
  758.           Blit 244,303,156
  759.           Use BitMap 4-db
  760.           Blit 244,303,156
  761.         Case 34
  762.           Use BitMap db
  763.           Blit 243,303,156
  764.           Use BitMap 4-db
  765.           Blit 243,303,156
  766.           bfra=-2 : shootout=-1
  767.       End Select
  768.     Case 3
  769.       Select bfra
  770.         Case 0
  771.           bx=148 : by=194
  772.           bxs=0 : bys=0
  773.         Case 10
  774.           Use BitMap db
  775.           BlitMode CookieMode
  776.           Blit 246,160,14
  777.           Blit 247,160,11
  778.           Use BitMap 4-db
  779.           BlitMode CookieMode
  780.           Blit 246,160,14
  781.           Blit 247,160,11
  782.         Case 12
  783.           Use BitMap db
  784.           BlitMode EraseMode
  785.           Blit 246,160,14
  786.           BlitMode CookieMode
  787.           Blit 246,160,18
  788.           Blit 247,160,11
  789.           Use BitMap 4-db
  790.           BlitMode EraseMode
  791.           Blit 246,160,14
  792.           BlitMode CookieMode
  793.           Blit 246,160,18
  794.           Blit 247,160,11
  795.         Case 14
  796.           bx=159 : by=24
  797.           bxs=0 : bys=7
  798.           bison=True
  799.         Case 26
  800.           Use BitMap db
  801.           BlitMode EraseMode
  802.           Blit 246,160,18
  803.           BlitMode CookieMode
  804.           Blit 246,160,14
  805.           Blit 247,160,11
  806.           Use BitMap 4-db
  807.           BlitMode EraseMode
  808.           Blit 246,160,18
  809.           BlitMode CookieMode
  810.           Blit 246,160,14
  811.           Blit 247,160,11
  812.         Case 28
  813.           Use BitMap db
  814.           BlitMode EraseMode
  815.           Blit 246,160,14
  816.           BlitMode CookieMode
  817.           Blit 247,160,11
  818.           Use BitMap 4-db
  819.           BlitMode EraseMode
  820.           Blit 246,160,14
  821.           BlitMode CookieMode
  822.           Blit 247,160,11
  823.           bfra=-2 : shootout=-1
  824.       End Select
  825.   End Select
  826. Return
  827.  
  828. .drawstats
  829.   USEPATH stats(0)
  830. ;player ones strength
  831.   Boxf 53+\stam,215,104,221,10
  832.   Boxf 53,215,53+\stam,221,5
  833. ;player ones gun overheat
  834.   Boxf 95,224,100,241-\heat,10
  835.   Boxf 95,241-\heat,100,241,6
  836.  
  837.   USEPATH stats(1)
  838. ;player twos strength
  839.   Boxf 215+\stam,215,266,221,10
  840.   Boxf 215,215,215+\stam,221,5
  841. ;player twos gun overheat
  842.   Boxf 219,224,224,241-\heat,10
  843.   Boxf 219,241-\heat,224,241,6
  844. Return
  845.  
  846. .drawscore
  847.   startx=-5
  848.   For sides=0 To 1
  849.     tstaties.l=stats(sides)\score
  850.     If tstaties>9999999 Then tstaties=-10000000+tstaties
  851.     flag=0 : stri$=Str$(tstaties)
  852.     retry:
  853.     If Len(stri$)<7
  854.       stri$="0"+stri$
  855.       Goto retry
  856.     EndIf
  857.     For scocount=1 To 7
  858.       startx+13
  859.       tempnum=Val(Mid$(stri$,scocount,1))
  860.       If tempnum=0 AND flag=0
  861.         Use BitMap db
  862.         Blit 340,startx,233
  863.         Use BitMap 4-db
  864.         Blit 340,startx,233
  865.       EndIf
  866.       If tempnum=0 AND (flag=1 OR scocount=7)
  867.         Use BitMap db
  868.         Blit 330,startx,233
  869.         Use BitMap 4-db
  870.         Blit 330,startx,233
  871.       EndIf
  872.       If tempnum>0
  873.         Use BitMap db
  874.         Blit 330+tempnum,startx,233
  875.         Use BitMap 4-db
  876.         Blit 330+tempnum,startx,233
  877.         flag=1
  878.       EndIf
  879.     Next scocount
  880.     startx=220
  881.   Next sides
  882. Return
  883.  
  884. .blocks
  885.   If bx<160
  886.     t=0
  887.     xstart=Int((bx-24)/18)-1
  888.     xend=Int((bx-24)/18)+1
  889.     ystart=Int((by-45)/8)-1
  890.     yend=Int((by-45)/8)+1
  891.     ptemp=24
  892.   Else
  893.     t=1
  894.     xstart=Int((bx-188)/18)-1
  895.     xend=Int((bx-188)/18)+1
  896.     ystart=Int((by-45)/8)-1
  897.     yend=Int((by-45)/8)+1
  898.     ptemp=188
  899.   EndIf
  900.   If xstart<0 Then xstart=0 Else If xstart>6 Then xstart=6
  901.   If xend<0 Then xend=0 Else If xend>6 Then xend=6
  902.   If ystart<0 Then ystart=0 Else If ystart>6 Then ystart=6
  903.   If yend<0 Then yend=0 Else If yend>6 Then yend=6
  904.  
  905.   If ying Then tempstat=1-t Else tempstat=t
  906.   For ytemp=ystart To yend
  907.   For xtemp=xstart To xend
  908.   If gridblock(t,xtemp,ytemp)<>0
  909.     If ShapesHit(232,bx,by,253,(xtemp*18)+ptemp,(ytemp*8)+45)
  910.       bys*-20
  911.       If bys>maxspeed Then bys=blockbounce
  912.       If bys<-maxspeed Then bys=-blockbounce
  913.       by+(bys/2)
  914.       stats(tempstat)\score+gridblock(t,xtemp,ytemp)
  915.       gridblock(t,xtemp,ytemp)=0 : numblocks(t)-1
  916.       BlitMode EraseMode
  917.       Use BitMap db
  918.       UnBuffer db
  919.       UnBuffer bdb
  920.       Blit 251,(xtemp*18)+ptemp,(ytemp*8)+45
  921.       BlitMode CookieMode
  922.       BBlit db,231,bx,by
  923.       If magnet Then BBlit db,248,magx,magy
  924.       If gogood<>-1 Then BBlit bdb,410+gogood,160,70
  925.       If goodon<>-1 Then BBlit bdb,431+curgood,160,70
  926.       If stopgood<>-1 Then BBlit bdb,410+stopgood,160,70
  927.       BlitMode EraseMode
  928.       Use BitMap 4-db
  929.       UnBuffer 4-db
  930.       UnBuffer 9-bdb
  931.       Blit 251,(xtemp*18)+ptemp,(ytemp*8)+45
  932.       BlitMode CookieMode
  933.       BBlit 4-db,231,bx,by
  934.       If magnet Then BBlit 4-db,248,magx,magy
  935.       If gogood<>-1 Then BBlit 9-bdb,410+gogood,160,70
  936.       If goodon<>-1 Then BBlit 9-bdb,431+curgood,160,70
  937.       If stopgood<>-1 Then BBlit 9-bdb,410+stopgood,160,70
  938.       sou(3)=True
  939.     EndIf
  940.     If ShapesHit(232,bx,by,252,(xtemp*18)+ptemp,(ytemp*8)+45)
  941.       bxs*-20
  942.       If bxs>maxspeed Then bxs=blockbounce
  943.       If bxs<-maxspeed Then bxs=-blockbounce
  944.       bx+(bxs/2)
  945.       stats(tempstat)\score+gridblock(t,xtemp,ytemp)
  946.       gridblock(t,xtemp,ytemp)=0 : numblocks(t)-1
  947.       BlitMode EraseMode
  948.       Use BitMap db
  949.       UnBuffer db
  950.       Blit 251,(xtemp*18)+ptemp,(ytemp*8)+45
  951.       Use BitMap 4-db
  952.       UnBuffer 4-db
  953.       Blit 251,(xtemp*18)+ptemp,(ytemp*8)+45
  954.       BlitMode CookieMode
  955.       sou(3)=True
  956.     EndIf
  957.   EndIf
  958.   Next xtemp
  959.   Next ytemp
  960. Return
  961.  
  962. .setblocks
  963.   ptemp=24
  964.   For t=0 To 1 : col=7
  965.   For ytemp=0 To 6 : col-1
  966.   If col<1 Then col=1
  967.   For xtemp=0 To 6
  968.     Use BitMap db
  969.     Blit 223+col,(xtemp*18)+ptemp,(ytemp*8)+45
  970.     Use BitMap 4-db
  971.     Blit 223+col,(xtemp*18)+ptemp,(ytemp*8)+45
  972.     gridblock(t,xtemp,ytemp)=col
  973.   Next xtemp
  974.   Next ytemp
  975.   ptemp=188
  976.   Next t
  977. Return
  978.  
  979. .sounds
  980.   For soucount=0 To 3
  981.     chan(3)=False
  982.   Next soucount
  983.   For snd=0 To 9
  984.     If sou(snd)=True
  985.       sou(snd)=False
  986.       temp=5
  987.       For co=0 To 3
  988.         If chan(co)=False AND temp=5 Then temp=co
  989.       Next co
  990.       If temp=5 Then temp=0
  991.       Select temp
  992.         Case 0 : temp=1
  993.         Case 1 : temp=2
  994.         Case 2 : temp=4
  995.         Case 3 : temp=8
  996.       End Select
  997.       Sound snd,temp
  998.     EndIf
  999.   Next snd
  1000. Return
  1001.  
  1002. .computestuck
  1003.   USEPATH guy(maincount)
  1004.   bx=\x+gun(maincount,\tpoint-1)\x
  1005.   by=\y+gun(maincount,\tpoint-1)\y
  1006.   Select \tpoint
  1007.     Case 1  : bxs=0   : bys=-27
  1008.     Case 2  : bxs=5   : bys=-25
  1009.     Case 3  : bxs=8   : bys=-20
  1010.     Case 4  : bxs=9   : bys=-8
  1011.     Case 5  : bxs=10  : bys=0
  1012.     Case 6  : bxs=7.5 : bys=2.5
  1013.     Case 7  : bxs=5   : bys=5
  1014.     Case 8  : bxs=2.5 : bys=7.5
  1015.     Case 9  : bxs=0   : bys=10
  1016.     Case 10 : bxs=-2.5: bys=7.5
  1017.     Case 11 : bxs=-5  : bys=5
  1018.     Case 12 : bxs=-7.5: bys=2.5
  1019.     Case 13 : bxs=-10 : bys=0
  1020.     Case 14 : bxs=-9  : bys=-8
  1021.     Case 15 : bxs=-8  : bys=-20
  1022.     Case 16 : bxs=-5  : bys=-25
  1023.   End Select
  1024. Return
  1025.  
  1026. .computesuck
  1027.   USEPATH guy(maincount)
  1028.   Select \tpoint
  1029.     Case 1
  1030.       If by<\y
  1031.         bys+0.1
  1032.         If bx<\x-30 Then bxs+0.2
  1033.         If bx>\x-30 AND bx<\x-10 Then bxs+0.4
  1034.         If bx>\x-10 AND bx<\x Then bxs+0.8
  1035.         If bx>\x AND bx<\x+10 Then bxs-0.8
  1036.         If bx>\x+10 AND bx<\x+30 Then bxs-0.4
  1037.         If bx>\x+30 Then bxs-0.2
  1038.       EndIf
  1039.       If by>\y
  1040.         If bx<\x-30 Then bxs+0.1
  1041.         If bx>\x-30 AND bx<\x-10 Then bxs+0.2
  1042.         If bx>\x-10 AND bx<\x Then bxs+0.1
  1043.         If bx>\x AND bx<\x+10 Then bxs-0.1
  1044.         If bx>\x+10 AND bx<\x+30 Then bxs-0.2
  1045.         If bx>\x+30 Then bxs-0.1
  1046.       EndIf
  1047.     Case 2
  1048.       If by<\y
  1049.         bys+0.1
  1050.         If bx<\x-10 Then bxs+0.2
  1051.         If bx>\x-10 AND bx<\x Then bxs+0.6
  1052.         If bx>\x AND bx<\x+10 Then bxs-0.8
  1053.         If bx>\x+10 AND bx<\x+30 Then bxs-0.4
  1054.         If bx>\x+30 Then bxs-0.2
  1055.       EndIf
  1056.       If by>\y
  1057.         If bx<\x-10 Then bxs+0.1
  1058.         If bx>\x-10 AND bx<\x Then bxs+0.1
  1059.         If bx>\x AND bx<\x+10 Then bxs-0.1
  1060.         If bx>\x+10 AND bx<\x+30 Then bxs-0.2
  1061.         If bx>\x+30 Then bxs-0.1
  1062.       EndIf
  1063.     Case 3
  1064.       If by<\y
  1065.         bys+0.1
  1066.         If bx<\x-10 Then bxs+0.1
  1067.         If bx>\x-10 AND bx<\x Then bxs+0.4
  1068.         If bx>\x AND bx<\x+10 Then bxs-0.4
  1069.         If bx>\x+10 AND bx<\x+30 Then bxs-0.6
  1070.         If bx>\x+30 Then bxs-0.4
  1071.       EndIf
  1072.       If by>\y
  1073.         If bx<\x-10 Then bxs+0.1
  1074.         If bx>\x-10 AND bx<\x Then bxs+0.1
  1075.         If bx>\x AND bx<\x+10 Then bxs-0.2
  1076.         If bx>\x+10 AND bx<\x+30 Then bxs-0.2
  1077.         If bx>\x+30 Then bxs-0.1
  1078.       EndIf
  1079.     Case 4
  1080.       If by<\y
  1081.         bys+0.1
  1082.         If bx>\x-10 AND bx<\x Then bxs+0.2
  1083.         If bx>\x AND bx<\x+20 Then bxs-0.4
  1084.         If bx>\x+20 AND bx<\x+40 Then bxs-0.8
  1085.         If bx>\x+40 Then bxs-0.6
  1086.       EndIf
  1087.       If by>\y
  1088.         If bx>\x-10 AND bx<\x Then bxs+0.1
  1089.         If bx>\x AND bx<\x+20 Then bxs-0.2
  1090.         If bx>\x+20 AND bx<\x+40 Then bxs-0.4
  1091.         If bx>\x+40 Then bxs-0.2
  1092.       EndIf
  1093.     Case 5
  1094.       If by<\y
  1095.         bys+0.1
  1096.         If bx>\x-10 AND bx<\x Then bxs+0.2
  1097.         If bx>\x AND bx<\x+20 Then bxs-0.4
  1098.         If bx>\x+20 AND bx<\x+40 Then bxs-0.8
  1099.         If bx>\x+40 Then bxs-0.6
  1100.       EndIf
  1101.       If by>\y
  1102.         If bx>\x-10 AND bx<\x Then bxs+0.1
  1103.         If bx>\x AND bx<\x+20 Then bxs-0.2
  1104.         If bx>\x+20 AND bx<\x+40 Then bxs-0.4
  1105.         If bx>\x+40 Then bxs-0.2
  1106.       EndIf
  1107.     Case 6
  1108.       If by<\y
  1109.         bys+0.1
  1110.         If bx>\x-10 AND bx<\x Then bxs+0.2
  1111.         If bx>\x AND bx<\x+20 Then bxs-0.4
  1112.         If bx>\x+20 AND bx<\x+40 Then bxs-0.8
  1113.         If bx>\x+40 Then bxs-0.6
  1114.       EndIf
  1115.       If by>\y
  1116.         If bx>\x-10 AND bx<\x Then bxs+0.1
  1117.         If bx>\x AND bx<\x+20 Then bxs-0.2
  1118.         If bx>\x+20 AND bx<\x+40 Then bxs-0.4
  1119.         If bx>\x+40 Then bxs-0.2
  1120.       EndIf
  1121.     Case 7
  1122.       If by<\y
  1123.         bys+0.1
  1124.         If bx>\x-10 AND bx<\x Then bxs+0.2
  1125.         If bx>\x AND bx<\x+20 Then bxs-0.4
  1126.         If bx>\x+20 AND bx<\x+40 Then bxs-0.8
  1127.         If bx>\x+40 Then bxs-0.6
  1128.       EndIf
  1129.       If by>\y
  1130.         If bx>\x-10 AND bx<\x Then bxs+0.1
  1131.         If bx>\x AND bx<\x+20 Then bxs-0.2
  1132.         If bx>\x+20 AND bx<\x+40 Then bxs-0.4
  1133.         If bx>\x+40 Then bxs-0.2
  1134.       EndIf
  1135.     Case 8
  1136.       If by<\y
  1137.         bys+0.1
  1138.         If bx>\x-10 AND bx<\x Then bxs+0.2
  1139.         If bx>\x AND bx<\x+10 Then bxs-0.4
  1140.         If bx>\x+10 AND bx<\x+30 Then bxs-0.6
  1141.         If bx>\x+30 Then bxs-0.4
  1142.       EndIf
  1143.       If by>\y
  1144.         If bx>\x-10 AND bx<\x Then bxs+0.1
  1145.         If bx>\x AND bx<\x+10 Then bxs-0.2
  1146.         If bx>\x+10 AND bx<\x+30 Then bxs-0.2
  1147.         If bx>\x+30 Then bxs-0.1
  1148.       EndIf
  1149.     Case 9
  1150.       If by<\y
  1151.         If bx<\x-30 Then bxs+0.2
  1152.         If bx>\x-30 AND bx<\x-10 Then bxs+0.4
  1153.         If bx>\x-10 AND bx<\x Then bxs+0.8
  1154.         If bx>\x AND bx<\x+10 Then bxs-0.8
  1155.         If bx>\x+10 AND bx<\x+30 Then bxs-0.4
  1156.         If bx>\x+30 Then bxs-0.2
  1157.       EndIf
  1158.       If by>\y
  1159.         If bx<\x-30 Then bxs+0.1
  1160.         If bx>\x-30 AND bx<\x-10 Then bxs+0.2
  1161.         If bx>\x-10 AND bx<\x Then bxs+0.1
  1162.         If bx>\x AND bx<\x+10 Then bxs-0.1
  1163.         If bx>\x+10 AND bx<\x+30 Then bxs-0.2
  1164.         If bx>\x+30 Then bxs-0.1
  1165.       EndIf
  1166.     Case 10
  1167.       If by<\y
  1168.         bys+0.1
  1169.         If bx<\x-30 Then bxs+0.4
  1170.         If bx<\x-10 AND bx>\x-30 Then bxs+0.6
  1171.         If bx<\x AND bx>\x-10 Then bxs+0.4
  1172.         If bx<\x+10 AND bx>\x Then bxs-0.2
  1173.       EndIf
  1174.       If by>\y
  1175.         If bx<\x-30 Then bxs+0.1
  1176.         If bx<\x-10 AND bx>\x-30 Then bxs+0.2
  1177.         If bx<\x AND bx>\x-10 Then bxs+0.2
  1178.         If bx<\x+10 AND bx>\x Then bxs-0.1
  1179.       EndIf
  1180.     Case 11
  1181.       If by<\y
  1182.         bys+0.1
  1183.         If bx<\x-40 Then bxs+0.6
  1184.         If bx<\x-20 AND bx>\x-40 Then bxs+0.8
  1185.         If bx<\x AND bx>\x-20 Then bxs+0.4
  1186.         If bx<\x+10 AND bx>\x Then bxs-0.2
  1187.       EndIf
  1188.       If by>\y
  1189.         If bx<\x-40 Then bxs+0.2
  1190.         If bx<\x-20 AND bx>\x-40 Then bxs+0.4
  1191.         If bx<\x AND bx>\x-20 Then bxs+0.2
  1192.         If bx<\x+10 AND bx>\x Then bxs-0.1
  1193.       EndIf
  1194.     Case 12
  1195.       If by<\y
  1196.         bys+0.1
  1197.         If bx<\x-40 Then bxs+0.6
  1198.         If bx<\x-20 AND bx>\x-40 Then bxs+0.8
  1199.         If bx<\x AND bx>\x-20 Then bxs+0.4
  1200.         If bx<\x+10 AND bx>\x Then bxs-0.2
  1201.       EndIf
  1202.       If by>\y
  1203.         If bx<\x-40 Then bxs+0.2
  1204.         If bx<\x-20 AND bx>\x-40 Then bxs+0.4
  1205.         If bx<\x AND bx>\x-20 Then bxs+0.2
  1206.         If bx<\x+10 AND bx>\x Then bxs-0.1
  1207.       EndIf
  1208.     Case 13
  1209.       If by<\y
  1210.         bys+0.1
  1211.         If bx<\x-40 Then bxs+0.6
  1212.         If bx<\x-20 AND bx>\x-40 Then bxs+0.8
  1213.         If bx<\x AND bx>\x-20 Then bxs+0.4
  1214.         If bx<\x+10 AND bx>\x Then bxs-0.2
  1215.       EndIf
  1216.       If by>\y
  1217.         If bx<\x-40 Then bxs+0.2
  1218.         If bx<\x-20 AND bx>\x-40 Then bxs+0.4
  1219.         If bx<\x AND bx>\x-20 Then bxs+0.2
  1220.         If bx<\x+10 AND bx>\x Then bxs-0.1
  1221.       EndIf
  1222.     Case 14
  1223.       If by<\y
  1224.         bys+0.1
  1225.         If bx<\x-40 Then bxs+0.6
  1226.         If bx<\x-20 AND bx>\x-40 Then bxs+0.8
  1227.         If bx<\x AND bx>\x-20 Then bxs+0.4
  1228.         If bx<\x+10 AND bx>\x Then bxs-0.2
  1229.       EndIf
  1230.       If by>\y
  1231.         If bx<\x-40 Then bxs+0.2
  1232.         If bx<\x-20 AND bx>\x-40 Then bxs+0.4
  1233.         If bx<\x AND bx>\x-20 Then bxs+0.2
  1234.         If bx<\x+10 AND bx>\x Then bxs-0.1
  1235.       EndIf
  1236.     Case 15
  1237.       If by<\y
  1238.         bys+0.1
  1239.         If bx<\x-30 Then bxs+0.4
  1240.         If bx>\x-30 AND bx<\x-10 Then bxs+0.6
  1241.         If bx>\x-10 AND bx<\x Then bxs+0.4
  1242.         If bx>\x AND bx<\x+10 Then bxs-0.4
  1243.         If bx>\x+10 Then bxs-0.2
  1244.       EndIf
  1245.       If by>\y
  1246.         If bx<\x-30 Then bxs+0.1
  1247.         If bx>\x+30 AND bx<\x-10 Then bxs+0.1
  1248.         If bx>\x-10 AND bx<\x Then bxs+0.1
  1249.         If bx>\x AND bx<\x+10 Then bxs-0.2
  1250.         If bx>\x+10 Then bxs-0.2
  1251.       EndIf
  1252.     Case 16
  1253.       If by<\y
  1254.         bys+0.1
  1255.         If bx<\x-30 Then bxs+0.2
  1256.         If bx>\x-30 AND bx<\x-10 Then bxs+0.4
  1257.         If bx>\x-10 AND bx<\x Then bxs+0.8
  1258.         If bx>\x AND bx<\x+10 Then bxs-0.6
  1259.         If bx>\x+10 Then bxs-0.2
  1260.       EndIf
  1261.       If by>\y
  1262.         If bx<\x-30 Then bxs+0.1
  1263.         If bx>\x-30 AND bx<\x-10 Then bxs+0.2
  1264.         If bx>\x-10 AND bx<\x Then bxs+0.1
  1265.         If bx>\x AND bx<\x+10 Then bxs-0.1
  1266.         If bx>\x+10 Then bxs-0.1
  1267.       EndIf
  1268.   End Select
  1269.   If bx>\x+gun(maincount,\tpoint-1)\x-10 AND bx<\x+gun(maincount,\tpoint)\x+10
  1270.     If by>\y+gun(maincount,\tpoint-1)\y-10 AND by<\y+gun(maincount,\tpoint)\y+10
  1271.       \stuck=True
  1272.       bx=\x+gun(maincount,\tpoint-1)\x
  1273.       by=\y+gun(maincount,\tpoint-1)\y
  1274.     EndIf
  1275.   EndIf
  1276. Return
  1277.  
  1278. .computeguys
  1279.   USEPATH guy(0)
  1280.   If \x<40
  1281.     \x=40
  1282.     \bshape=\bstill
  1283.   EndIf
  1284.   If \x>118
  1285.     \x=118
  1286.     \bshape=\bstill
  1287.   EndIf
  1288.   If ShapesHit(231,bx,by,\tshape,\x+\xt,\y+\yt)
  1289.     tempx=0 : tempy=0
  1290.     If Left$(Str$(bxs),1)="-" Then tempx=-bxs Else tempx=bxs
  1291.     If Left$(Str$(bys),1)="-" Then tempy=-bys Else tempy=bys
  1292.     If (tempx>2 OR tempy>2) AND \stuck=False Then stats(0)\stam-(tempx+tempy)/16
  1293.     If stats(0)\stam<0 Then stats(0)\stam=0
  1294.   EndIf
  1295.   If ying Then temp=1 Else temp=0
  1296.   If guy(0)\stuck=True Then stats(temp)\heat-0.5
  1297.   If guy(0)\stuck=False Then stats(temp)\heat=17
  1298.   If stats(temp)\heat<0
  1299.     stats(temp)\stam-0.5
  1300.     stats(temp)\heat=0
  1301.   EndIf
  1302.   If stats(temp)\stam<0.5 Then Goto quit
  1303.   ;If stats(temp)\stam<0.5 : Stop : Goto quit : EndIf
  1304.  
  1305.   USEPATH guy(1)
  1306.   If \x<202
  1307.     \x=202
  1308.     \bshape=\bstill
  1309.   EndIf
  1310.   If \x>280
  1311.     \x=280
  1312.     \bshape=\bstill
  1313.   EndIf
  1314.   If ShapesHit(231,bx,by,\tshape,\x+\xt,\y+\yt)
  1315.     If Left$(Str$(bxs),1)="-" Then tempx=-bxs Else tempx=bxs
  1316.     If Left$(Str$(bys),1)="-" Then tempy=-bys Else tempy=bys
  1317.     If (tempx>2 OR tempy>2) AND \stuck=Fals Then stats(1)\stam-(tempx+tempy)/8
  1318.     If stats(1)\stam<0 Then stats(1)\stam=0
  1319.   EndIf
  1320.   If ying Then temp=0 Else temp=1
  1321.   If guy(1)\stuck=True Then stats(temp)\heat-0.5
  1322.   If guy(1)\stuck=False Then stats(temp)\heat=17
  1323.   If stats(temp)\heat<0
  1324.     stats(temp)\stam-0.5
  1325.     stats(temp)\heat=0
  1326.   EndIf
  1327.   If stats(temp)\stam<0.5 Then Goto quit
  1328.   ;If stats(temp)\stam<0.5 : Stop : Goto quit : EndIf
  1329. Return
  1330.  
  1331. .readkey
  1332.   If ying Then temp=1-maincount Else temp=maincount
  1333.   USEPATH guy(temp)
  1334.  
  1335.   Select RawStatus(control(maincount)\fire)
  1336.     Case 0
  1337.       If \stuck=True Then lasthad=maincount
  1338.       \suck=False : \stuck=False : none=True
  1339.       If RawStatus(control(maincount)\right)
  1340.         If tim=1 OR tim=2 OR tim=5 OR tim=6
  1341.           \x+\movspd
  1342.           If (\bshape=\bstill)OR(\bshape>=\bfirstl AND \bshape<=\blastl) Then \bshape=\blastr
  1343.           \bshape+1
  1344.           If \bshape>\blastr Then \bshape=\bfirstr
  1345.         EndIf
  1346.         none=False
  1347.       EndIf
  1348.       If RawStatus(control(maincount)\left)
  1349.         If tim=1 OR tim=2 OR tim=5 OR tim=6
  1350.           \x-\movspd
  1351.           If (\bshape=\bstill)OR(\bshape>=\bfirstr AND \bshape<=\blastr) Then \bshape=\blastl
  1352.           \bshape+1
  1353.           If \bshape>\blastl Then \bshape=\bfirstl
  1354.         EndIf
  1355.         none=False
  1356.       EndIf
  1357.       If none Then \bshape=\bstill
  1358.     Case -1
  1359.       \suck=True
  1360.       \bshape=\bstill
  1361.       If tim=1 OR tim=2 OR tim=5 OR tim=6
  1362.         If RawStatus(control(maincount)\right)
  1363.           \tshape+1 : \tpoint+1
  1364.           If \tshape>\tlast
  1365.             \tshape=\tfirst
  1366.             \tpoint=1
  1367.           EndIf
  1368.         EndIf
  1369.         If RawStatus(control(maincount)\left)
  1370.           \tshape-1 : \tpoint-1
  1371.           If \tshape<\tfirst
  1372.             \tshape=\tlast
  1373.             \tpoint=16
  1374.           EndIf
  1375.         EndIf
  1376.       EndIf
  1377.   End Select
  1378. Return
  1379.  
  1380. .readjoy
  1381.   If ying Then temp=1-maincount Else temp=maincount
  1382.   USEPATH guy(temp)
  1383.  
  1384.   Select Joyb(jo)
  1385.     Case 0
  1386.       If \stuck=True Then lasthad=maincount
  1387.       \suck=False : \stuck=False
  1388.       Select Joyx(jo)
  1389.         Case 0 : \bshape=\bstill
  1390.         Case 1
  1391.           If tim=1 OR tim=3 OR tim=5 OR tim=7
  1392.             \x+\movspd
  1393.             If (\bshape=\bstill)OR(\bshape>=\bfirstl AND \bshape<=\blastl) Then \bshape=\blastr
  1394.             \bshape+1
  1395.             If \bshape>\blastr Then \bshape=\bfirstr
  1396.           EndIf
  1397.         Case -1
  1398.           If tim=1 OR tim=3 OR tim=5 OR tim=7
  1399.             \x-\movspd
  1400.             If (\bshape=\bstill)OR(\bshape>=\bfirstr AND \bshape<=\blastr) Then \bshape=\blastl
  1401.             \bshape+1
  1402.             If \bshape>\blastl Then \bshape=\bfirstl
  1403.           EndIf
  1404.       End Select
  1405.     Case 1
  1406.       \suck=True
  1407.       \bshape=\bstill
  1408.       If tim=1 OR tim=3 OR tim=5 OR tim=7
  1409.         Select Joyx(jo)
  1410.           Case 1
  1411.             \tshape+1 : \tpoint+1
  1412.             If \tshape>\tlast
  1413.               \tshape=\tfirst
  1414.               \tpoint=1
  1415.             EndIf
  1416.           Case -1
  1417.             \tshape-1 : \tpoint-1
  1418.             If \tshape<\tfirst
  1419.               \tshape=\tlast
  1420.               \tpoint=16
  1421.             EndIf
  1422.         End Select
  1423.       EndIf
  1424.   End Select
  1425. Return
  1426.  
  1427. .getguybits
  1428.   For c=0 To 1
  1429.     USEPATH guy(c)
  1430.     If \char=1 Then Restore guydata1
  1431.     If \char=2 Then Restore guydata2
  1432.     If \char=3 Then Restore guydata3
  1433.     If \char=4 Then Restore guydata4
  1434.     If \char=5 Then Restore guydata5
  1435.  
  1436.     If c=0 Then \x=80 Else \x=240
  1437.     \y=200
  1438.  
  1439.     Read \xt,\yt
  1440.     Read \tpoint,\tstill
  1441.     Read \tshape,\tfirst,\tlast
  1442.     Read \suck,\stuck
  1443.  
  1444.     Read \xb,\yb
  1445.     Read \bshape,\bstill
  1446.     Read \bfirstr,\blastr
  1447.     Read \bfirstl,\blastl
  1448.     Read \movspd
  1449.  
  1450.     For xy=0 To 15
  1451.       Read gun(c,xy)\x,gun(c,xy)\y
  1452.     Next xy
  1453.   Next c
  1454. Return
  1455.  
  1456. .blitall
  1457.   While VPos<255 : Wend
  1458. ;  VWait 10  ;  see it slower, for debugging
  1459.   DisplayBitMap 0,db
  1460.   db=4-db : bdb=9-bdb
  1461.   Use BitMap db
  1462.   Gosub drawstats
  1463.  
  1464.   If tim=5 OR tim=6
  1465.     For ts=0 To 13
  1466.       USEPATH top(ts)
  1467.       If \f>0
  1468.         If \f=2 Then \y=18
  1469.         Use BitMap db
  1470.         Blit 233,\x,\y
  1471.         \f-1
  1472.       EndIf
  1473.     Next ts
  1474.   EndIf
  1475.  
  1476.   UnBuffer db
  1477.   UnBuffer db+1
  1478.   UnBuffer bdb
  1479.   For c=0 To 1
  1480.     USEPATH guy(c)
  1481.     BBlit db+1,\bshape,\x+\xb,\y+\yb
  1482.     BBlit db+1,\tshape,\x+\xt,\y+\yt
  1483.   Next c
  1484.   BBlit db+1,237,160,pluny
  1485.   If gogood<>-1 Then BBlit bdb,410+gogood,160,70
  1486.   If goodon<>-1 Then BBlit bdb,431+curgood,160,70
  1487.   If stopgood<>-1 Then BBlit bdb,410+stopgood,160,70
  1488.   Blit tvframe,160,225
  1489.   BBlit db,231,bx,by
  1490.   If magnet Then BBlit db,248,magx,magy
  1491. Return
  1492.  
  1493. .computeobjects
  1494.   Use BitMap 3
  1495.   UnQueue 0
  1496.   QBlit 0,232,bx,by
  1497.   If by<30
  1498.     For ts=0 To 13
  1499.       If ShapesHit(232,bx,by,234,top(ts)\x,18)
  1500.         top(ts)\y=19
  1501.         top(ts)\f=3
  1502.         If ts=0 Then bxs=6
  1503.         If ts=6 Then bxs=-10
  1504.         If ts=7 Then bxs=10
  1505.         If ts=13 Then bxs=-6
  1506.         bxs/2 : bx+bxs
  1507.         bys=maxspeed : by+bys
  1508.         sou(1)=True
  1509.       EndIf
  1510.     Next ts
  1511.   EndIf
  1512.   If pluny<>187 Then pluny+1
  1513.   If by>175
  1514.     If ShapesHit(232,bx,by,238,160,pluny)
  1515.       pluny=184 : bys=-plunhit : by+bys
  1516.       bxs+Rnd(0.4)-0.2 : bxs*Int(Rnd(2))-1
  1517.       sou(2)=True
  1518.     EndIf
  1519.     If BlitColl(235,22,194) OR BlitColl(235,184,194)
  1520.       bxs=Rnd(10)+2 : bys=-Rnd(12)-2
  1521.       bx+bxs : by+bys
  1522.       sou(1)=True
  1523.     EndIf
  1524.     If BlitColl(236,136,194) OR BlitColl(236,298,194)
  1525.       bxs=-Rnd(10)-2 : bys=-Rnd(12)-2
  1526.       bx+bxs : by+bys
  1527.       sou(1)=True
  1528.     EndIf
  1529.   EndIf
  1530. Return
  1531.  
  1532. .computeball
  1533. ; the x ball follows:
  1534.   Use BitMap 1
  1535.   If BlitColl(232,bx,by)
  1536.     bxs*-0.6
  1537.     bx+(bxs*1.35)
  1538.     If bxs<-0.3 OR bxs>0.3 Then sou(0)=True
  1539.   EndIf
  1540.   If BlitColl(232,bx,by) Then bxs+(bxs)
  1541.  
  1542.   If cheat=True
  1543.     If RawStatus(chleft) Then bxs-0.2
  1544.     If RawStatus(chright) Then bxs+0.2
  1545.   EndIf
  1546.  
  1547.   bxs-(bxs/80)
  1548.   bx+bxs
  1549.   temp=bxs
  1550.   If Left$(Str$(bxs),1)="-" Then temp=-temp
  1551.   If temp<0.1 Then bxs=0
  1552.  
  1553.   For aircount=0 To air
  1554.     If bxs>maxspeed Then bxs-0.1
  1555.     If bxs<-maxspeed Then bxs+0.1
  1556.   Next aircount
  1557.  
  1558. ; the y ball follows
  1559.   Use BitMap 2
  1560.   If BlitColl(232,bx,by)
  1561.     bys*-0.6
  1562.     by+(bys*1.6677)
  1563.     If bys<-0.5 OR bys>0.5 Then sou(0)=True
  1564.   EndIf
  1565.   If BlitColl(232,bx,by) Then bys+(bys)
  1566.  
  1567.   If cheat=True
  1568.     If RawStatus(chup) Then bys-0.8
  1569.     If RawStatus(chdown) Then bys+0.4
  1570.   EndIf
  1571.  
  1572.   bys+0.1
  1573.   If Left$(Str$(bys),1)<>"-" Then bys-((-bys)/20)
  1574.   If Left$(Str$(bys),1)="-" Then bys+((-bys)/10)
  1575.   by+bys
  1576.  
  1577.   For aircount=0 To air
  1578.     If bys>maxspeed Then bys-0.1
  1579.     If bys<-maxspeed Then bys+0.1
  1580.   Next aircount
  1581. Return
  1582.  
  1583. .getoptions
  1584.   cheatamo=1+5
  1585.   cheatcount=0
  1586.   Dim cheater(cheatamo)
  1587.   cheater(0)=cheatamo-1
  1588.   cheater(1)=$33
  1589.   cheater(2)=$25
  1590.   cheater(3)=$12
  1591.   cheater(4)=$20
  1592.   cheater(5)=$14
  1593.  
  1594.   cheat=False
  1595.  
  1596.   title=True
  1597.   logo=True
  1598.  
  1599.   guy(0)\brain=True
  1600.   control(0)\joy=True
  1601.   guy(1)\brain=False
  1602.   control(1)\joy=False
  1603.  
  1604.   QAMIGA
  1605.   If ReadFile(0,"HSDaa/optdat")
  1606.     FileInput 0
  1607.  
  1608.     Gosub readlen : logo=Val(lngth$)
  1609.     Gosub readlen : title=Val(lngth$)
  1610.     Gosub readlen : guy(0)\brain=Val(lngth$)
  1611.     Gosub readlen : control(0)\joy=Val(lngth$)
  1612.     Gosub readlen : guy(1)\brain=Val(lngth$)
  1613.     Gosub readlen : control(1)\joy=Val(lngth$)
  1614.     Gosub readlen : maxspeed=Val(lngth$)
  1615.  
  1616.     DefaultOutput
  1617.     CloseFile 0
  1618.   EndIf
  1619.   ;Delay_(2000)
  1620.   BLITZ
  1621.  
  1622.   Dim fon(10)
  1623.  
  1624.   fkey(0)\x=32 : fkey(0)\y=31
  1625.   fkey(0)\xs=0 : fkey(0)\ys=0
  1626.   fkey(0)\xa=42 : fkey(0)\ya=36
  1627.   fkey(0)\f=421
  1628.   fon(0)=True
  1629.  
  1630.   fkey(1)\x=286 : fkey(1)\y=31
  1631.   fkey(1)\xs=0 : fkey(1)\ys=0
  1632.   fkey(1)\xa=276 : fkey(1)\ya=36
  1633.   fkey(1)\f=422
  1634.   fon(1)=True
  1635.  
  1636.   fkey(2)\x=42 : fkey(2)\y=122
  1637.   fkey(2)\xs=0 : fkey(2)\ys=0
  1638.   fkey(2)\xa=32 : fkey(2)\ya=117
  1639.   fkey(2)\f=423
  1640.   fon(2)=False
  1641.  
  1642.   fkey(3)\x=266 : fkey(3)\y=122
  1643.   fkey(3)\xs=0 : fkey(3)\ys=0
  1644.   fkey(3)\xa=276 : fkey(3)\ya=117
  1645.   fkey(3)\f=424
  1646.   fon(3)=False
  1647.  
  1648.   fkey(4)\x=174 : fkey(4)\y=182
  1649.   fkey(4)\xs=0 : fkey(4)\ys=0
  1650.   fkey(4)\xa=159 : fkey(4)\ya=177
  1651.   fkey(4)\f=425
  1652.   fon(4)=True
  1653.  
  1654.   fkey(5)\x=132 : fkey(5)\y=245
  1655.   fkey(5)\xs=0 : fkey(5)\ys=0
  1656.   fkey(5)\xa=137 : fkey(5)\ya=240
  1657.   fkey(5)\f=426
  1658.   fon(5)=True
  1659.  
  1660.   fkey(6)\x=186 : fkey(6)\y=235
  1661.   fkey(6)\xs=0 : fkey(6)\ys=0
  1662.   fkey(6)\xa=181 : fkey(6)\ya=240
  1663.   fkey(6)\f=427
  1664.   fon(6)=True
  1665.  
  1666.   fkey(7)\x=160 : fkey(7)\y=128
  1667.   fkey(7)\xs=0 : fkey(7)\ys=0
  1668.   fkey(7)\xa=159 : fkey(7)\ya=127
  1669.   fkey(7)\f=428
  1670.   fon(7)=False
  1671.  
  1672.   fkey(8)\x=12 : fkey(8)\y=209
  1673.   fkey(8)\xs=0 : fkey(8)\ys=0
  1674.   fkey(8)\xa=17 : fkey(8)\ya=205
  1675.   fkey(8)\f=429
  1676.   fon(8)=True
  1677.  
  1678.   fkey(9)\x=307 : fkey(9)\y=209
  1679.   fkey(9)\xs=0 : fkey(9)\ys=0
  1680.   fkey(9)\xa=302 : fkey(9)\ya=205
  1681.   fkey(9)\f=430
  1682.   fon(9)=True
  1683. Return
  1684.  
  1685. .readlen
  1686.   lngth$=""
  1687.   place:
  1688.   single$=Edit$(1)
  1689.   If single$<>" "
  1690.     lngth$+single$
  1691.     Goto place
  1692.   EndIf
  1693. Return
  1694.  
  1695. .optionscreen
  1696.   QAMIGA
  1697.   LoadBitMap 7,"HSDaa/option",3
  1698.   LoadPalette 4,"HSDaa/optionpal"
  1699.   ;Delay_(2000)
  1700.   BLITZ
  1701.   Use BitMap 7
  1702.   DisplayBitMap 0,7
  1703.   DisplayPalette 0,3
  1704.   InitPalette 2,16
  1705.   DisplayPalette 0,2
  1706.  
  1707.   UnBuffer 3
  1708.   If guy(0)\brain=False
  1709.     Blit 401,91,58
  1710.     Blit 404,92,114
  1711.     Blit 416,39,166
  1712.   Else
  1713.     Blit 400,91,58
  1714.     fon(2)=True
  1715.     If control(0)\joy=True
  1716.       Blit 402,92,114
  1717.       Blit 416,39,166
  1718.     Else
  1719.       Blit 403,92,114
  1720.       Blit 414,39,166
  1721.     EndIf
  1722.   EndIf
  1723.   If guy(1)\brain=False
  1724.     Blit 401,225,58
  1725.     Blit 404,226,114
  1726.     Blit 417,266,166
  1727.   Else
  1728.     Blit 400,225,58
  1729.     fon(3)=True
  1730.     If control(1)\joy=True
  1731.       Blit 402,226,114
  1732.       Blit 417,266,166
  1733.     Else
  1734.       Blit 403,226,114
  1735.       Blit 415,266,166
  1736.     EndIf
  1737.   EndIf
  1738.   If title=True Then Blit 408,99,240
  1739.   If title=False Then Blit 407,99,240
  1740.   If logo=True Then Blit 409,219,240
  1741.   If logo=False Then Blit 407,219,240
  1742.   If maxspeed=3 Then Blit 405,159,144
  1743.   If maxspeed=5 Then Blit 418,159,144
  1744.   If maxspeed=8 Then Blit 406,159,144
  1745.  
  1746.   If cheat Then optpal=4 Else optpal=3
  1747.   pal=optpal : Gosub fadeitin
  1748.   DisplayPalette 0,optpal
  1749.  
  1750.   timmy=0 : cheatcount=1
  1751.   repdel=0 : repamo=10
  1752.   Repeat
  1753.     timmy=QWrap(timmy+1,1,5)
  1754.     For fcount=0 To 9
  1755.       USEPATH fkey(fcount)
  1756.       If \x>\xa Then \xs-0.3
  1757.       If \x<\xa Then \xs+0.3
  1758.       If \y>\ya Then \ys-1
  1759.       If \y<\ya Then \ys+1
  1760.       \x+\xs : \y+\ys
  1761.     Next fcount
  1762.  
  1763.     If RawStatus(cheater(cheatcount))
  1764.       If RawStatus(cheater(cheatamo-1))
  1765.         jump=False : cheatcount=0
  1766.         If cheat=True
  1767.           cheat=False
  1768.           pal=optpal : Gosub fadeitout
  1769.           optpal=3
  1770.           pal=optpal : Gosub fadeitin
  1771.           jump=True
  1772.         EndIf
  1773.         If cheat=False AND jump=False
  1774.           cheat=True
  1775.           pal=optpal : Gosub fadeitout
  1776.           optpal=4
  1777.           pal=optpal : Gosub fadeitin
  1778.         EndIf
  1779.       EndIf
  1780.       cheatcount+1
  1781.     EndIf
  1782.  
  1783.     repdel-1 : If repdel<0 Then repdel=0
  1784.     If repdel=0
  1785.     If RawStatus($50)
  1786.       repdel=repamo : jump=False
  1787.       If guy(0)\brain=True
  1788.         guy(0)\brain=False
  1789.         Blit 401,91,58
  1790.         fon(2)=False
  1791.         Blit 404,92,114
  1792.         Blit 416,39,166
  1793.         jump=True
  1794.       EndIf
  1795.       If guy(0)\brain=False AND jump=False
  1796.         guy(0)\brain=True
  1797.         Blit 400,91,58
  1798.         fon(2)=True
  1799.         If control(0)\joy=True
  1800.           Blit 402,92,114
  1801.           Blit 416,39,166
  1802.         EndIf
  1803.         If control(0)\joy=False
  1804.           Blit 403,92,114
  1805.           Blit 414,39,166
  1806.         EndIf
  1807.       EndIf
  1808.     EndIf
  1809.     If RawStatus($52) AND guy(0)\brain=True
  1810.       repdel=repamo : jump=False
  1811.       If control(0)\joy=True
  1812.         control(0)\joy=False
  1813.         Blit 403,92,114
  1814.         Blit 414,39,166
  1815.         jump=True
  1816.       EndIf
  1817.       If control(0)\joy=False AND jump=False
  1818.         control(0)\joy=True
  1819.         Blit 402,92,114
  1820.         Blit 416,39,166
  1821.       EndIf
  1822.     EndIf
  1823.     If RawStatus($51)
  1824.       repdel=repamo : jump=False
  1825.       If guy(1)\brain=True
  1826.         guy(1)\brain=False
  1827.         Blit 401,225,58
  1828.         fon(3)=False
  1829.         Blit 404,226,114
  1830.         Blit 417,266,166
  1831.         jump=True
  1832.       EndIf
  1833.       If guy(1)\brain=False AND jump=False
  1834.         guy(1)\brain=True
  1835.         Blit 400,225,58
  1836.         fon(3)=True
  1837.         If control(1)\joy=True
  1838.           Blit 402,226,114
  1839.           Blit 417,266,166
  1840.         EndIf
  1841.         If control(1)\joy=False
  1842.           Blit 403,226,114
  1843.           Blit 415,266,166
  1844.         EndIf
  1845.       EndIf
  1846.     EndIf
  1847.     If RawStatus($53) AND guy(1)\brain=True
  1848.       repdel=repamo : jump=False
  1849.       If control(1)\joy=True
  1850.         control(1)\joy=False
  1851.         Blit 403,226,114
  1852.         Blit 415,266,166
  1853.         jump=True
  1854.       EndIf
  1855.       If control(1)\joy=False AND jump=False
  1856.         control(1)\joy=True
  1857.         Blit 402,226,114
  1858.         Blit 417,266,166
  1859.       EndIf
  1860.     EndIf
  1861.     If RawStatus($55)
  1862.       repdel=repamo : jump=False
  1863.       If title=True
  1864.         title=False
  1865.         Blit 407,99,240
  1866.         jump=True
  1867.       EndIf
  1868.       If title=False AND jump=False
  1869.         title=True
  1870.         Blit 408,99,240
  1871.       EndIf
  1872.     EndIf
  1873.     If RawStatus($56)
  1874.       repdel=repamo : jump=False
  1875.       If logo=True
  1876.         logo=False
  1877.         Blit 407,219,240
  1878.         jump=True
  1879.       EndIf
  1880.       If logo=False AND jump=False
  1881.         logo=True
  1882.         Blit 409,219,240
  1883.       EndIf
  1884.     EndIf
  1885.     If RawStatus($54)
  1886.       repdel=repamo : jump=False : jump2=False
  1887.       If maxspeed=8
  1888.         maxspeed=3
  1889.         Blit 405,159,144
  1890.         jump=True
  1891.       EndIf
  1892.       If maxspeed=3 AND jump=False
  1893.         maxspeed=5
  1894.         Blit 418,159,144
  1895.         jump2=True
  1896.       EndIf
  1897.       If maxspeed=5 AND jump=False AND jump2=False
  1898.         maxspeed=8
  1899.         Blit 406,159,144
  1900.       EndIf
  1901.     EndIf
  1902.     If RawStatus($58)
  1903.       repdel=repamo
  1904.       QAMIGA
  1905.       If WriteFile(0,"HSDaa/optdat")
  1906.         FileOutput 0
  1907.         Print logo," "
  1908.         Print title," "
  1909.         Print guy(0)\brain," "
  1910.         Print control(0)\joy," "
  1911.         Print guy(1)\brain," "
  1912.         Print control(1)\joy," "
  1913.         Print maxspeed," "
  1914.         DefaultOutput
  1915.         CloseFile 0
  1916.       EndIf
  1917.       ;Delay_(2000)
  1918.       BLITZ
  1919.     EndIf
  1920.     EndIf
  1921.  
  1922.     VWait
  1923.     UnBuffer 3
  1924.     For fbcount=0 To 9
  1925.       If fon(fbcount)
  1926.         USEPATH fkey(fbcount)
  1927.         BBlit 3,\f,\x,\y
  1928.       EndIf
  1929.     Next fbcount
  1930.     If RawStatus($45) Then Goto quit
  1931.     ;If RawStatus($45) : Stop : Goto quit : EndIf
  1932.   Until RawStatus($59) OR Joyb(0)=1 OR Joyb(1)=1 OR RawStatus($40) OR RawStatus(control(0)\fire) OR RawStatus(control(1)\fire)
  1933.  
  1934.   pal=optpal : Gosub fadeitout
  1935.   UnBuffer 3
  1936.   Free Palette 2
  1937.   Free BitMap 7
  1938.   Free Palette 4
  1939.   blockbounce=maxspeed+3
  1940. Return
  1941.  
  1942. .titlescreen
  1943.   QAMIGA
  1944.   LoadBitMap 5,"HSDaa/title",1
  1945.   CopyBitMap 5,6
  1946.   LoadMedModule 0,"HSDaa/med"
  1947.   ;Delay_(2000)
  1948.   BLITZ
  1949.   Use BitMap 5
  1950.   DisplayBitMap 0,5
  1951.   DisplayPalette 0,1
  1952.   InitPalette 2,16
  1953.   DisplayPalette 0,2
  1954.  
  1955.   UnBuffer 3 : UnBuffer 6
  1956.   USEPATH hotshot(0)
  1957.   \x=210 : \y=115 : \xs=0 : \ys=0
  1958.   \xa=230 : \ya=115 : \f=161
  1959.   BBlit 3,\f,\x,\y
  1960.   USEPATH hotshot(1)
  1961.   \x=227 : \y=180 : \xs=0 : \ys=0
  1962.   \xa=227 : \ya=200 : \f=166
  1963.   BBlit 3,\f,\x,\y
  1964.  
  1965.   pal=1 : Gosub fadeitin
  1966.   DisplayPalette 0,1
  1967.   StartMedModule 0
  1968.  
  1969.   timmy=0
  1970.   bm=5 : bf=3
  1971.   medcount=64 : fadestart=False
  1972.   SetMedVolume medcount
  1973.   Repeat
  1974.     timmy=QWrap(timmy+1,1,5)
  1975.     For hotcount=0 To 1
  1976.       USEPATH hotshot(hotcount)
  1977.       If \x>\xa Then \xs-0.3
  1978.       If \x<\xa Then \xs+0.3
  1979.       If \y>\ya Then \ys-1
  1980.       If \y<\ya Then \ys+1
  1981.       \x+\xs : \y+\ys
  1982.       If hotcount=0 AND timmy=1 Then \f=QWrap(\f+1,161,166)
  1983.       If hotcount=1 AND timmy=2 Then \f=Int((Rnd(5)+1)+165)
  1984.     Next hotcount
  1985.     bm=11-bm : bf=9-bf
  1986.     PlayMed
  1987.     If VPos>200 Then VWait
  1988.     DisplayBitMap 0,11-bm
  1989.     Use BitMap bm
  1990.     UnBuffer bf
  1991.     For hotbcount=0 To 1
  1992.       USEPATH hotshot(hotbcount)
  1993.       BBlit bf,\f,\x,\y
  1994.     Next hotbcount
  1995.     If RawStatus($45) Then Goto quit
  1996.     ;If RawStatus($45) : Stop : Goto quit : EndIf
  1997.     If Joyb(0)=1 OR Joyb(1)=1 OR RawStatus($40) OR RawStatus(control(0)\fire) OR RawStatus(control(1)\fire) Then fadestart=True
  1998.     If fadestart=True
  1999.       medcount-1
  2000.       SetMedVolume medcount
  2001.     EndIf
  2002.   Until medcount=2
  2003.   StopMed
  2004.  
  2005.   pal=1 : Gosub fadeitout
  2006.   UnBuffer 3 : UnBuffer 6
  2007.   Free Palette 2
  2008.   Free BitMap 5
  2009.   Free BitMap 6
  2010.   Free MedModule 0
  2011. Return
  2012.  
  2013. fadeitin:
  2014.   fadecount=0.1
  2015.   Repeat
  2016.     FadePalette pal,2,fadecount
  2017.     DisplayPalette 0,2
  2018.     VWait
  2019.     fadecount+0.1
  2020.   Until fadecount>1
  2021. Return
  2022.  
  2023. fadeitout:
  2024.   fadecount=0.9
  2025.   Repeat
  2026.     FadePalette pal,2,fadecount
  2027.     DisplayPalette 0,2
  2028.     VWait
  2029.     fadecount-0.1
  2030.   Until fadecount<0
  2031. Return
  2032.  
  2033. .initrain
  2034.   r=8 : b=9
  2035.   For i=0 To 26
  2036.     r=QLimit(r-0.7,0,8)
  2037.     b=QLimit(b-0.3,0,9)
  2038.     DisplayRGB 0,0,i*4+10,r,0,b
  2039.   Next i
  2040. Return
  2041.  
  2042. topspring:
  2043.   Data 24,42,60,78,96,114,132,188,206,224,242,260,278,296
  2044.  
  2045. guydata1:
  2046.   Data 0,-2         ; xt,yt        ; top shape offset
  2047.   Data 1            ; tpoint       ; rotation frame number
  2048.   Data 81           ; tstill       ; top still number
  2049.   Data 1            ; tshape       ; top shape number
  2050.   Data 1            ; tfirst       ; first shape of rotation
  2051.   Data 16           ; tlast        ; last shape of rotation
  2052.  
  2053.   Data 0            ; suck         ; suction state
  2054.   Data 0            ; stuck        ; if ball is stuck on gun
  2055.  
  2056.   Data 0,6          ; xb,yb        ; bottom shape offset
  2057.   Data 156          ; bstill       ; bottom still number
  2058.   Data 156          ; bshape       ; bottom shape number
  2059.   Data 86           ; bfirstr      ; first shape of running right
  2060.   Data 92           ; blastr       ; last shape of running right
  2061.   Data 121          ; bfirstl      ; first shape of running left
  2062.   Data 127          ; blastl       ; last shape of running left
  2063.  
  2064.   Data 5            ; movspd       ; movement speed
  2065.  
  2066.                                    ; gun x,y offset
  2067.   Data 0,-17
  2068.   Data 7,-15
  2069.   Data 11,-12
  2070.   Data 13,-6
  2071.  
  2072.   Data 15,0
  2073.   Data 12,4
  2074.   Data 10,7
  2075.   Data 6,10
  2076.  
  2077.   Data 0,10
  2078.   Data -6,10
  2079.   Data -10,7
  2080.   Data -12,4
  2081.  
  2082.   Data -15,0
  2083.   Data -13,-6
  2084.   Data -11,-12
  2085.   Data -7,-15
  2086.  
  2087. guydata2:
  2088.   Data 0,-2         ; xt,yt        ; top shape offset
  2089.   Data 1            ; tpoint       ; rotation frame number
  2090.   Data 82           ; tstill       ; top still number
  2091.   Data 17           ; tshape       ; top shape number
  2092.   Data 17           ; tfirst       ; first shape of rotation
  2093.   Data 32           ; tlast        ; last shape of rotation
  2094.  
  2095.   Data 0            ; suck         ; suction state
  2096.   Data 0            ; stuck        ; if ball is stuck on gun
  2097.  
  2098.   Data 0,6          ; xb,yb        ; bottom shape offset
  2099.   Data 157          ; bstill       ; bottom still number
  2100.   Data 157          ; bshape       ; bottom shape number
  2101.   Data 93           ; bfirstr      ; first shape of running right
  2102.   Data 99           ; blastr       ; last shape of running right
  2103.   Data 128          ; bfirstl      ; first shape of running left
  2104.   Data 134          ; blastl       ; last shape of running left
  2105.  
  2106.   Data 5            ; movspd       ; movement speed
  2107.  
  2108.                                    ; gun x,y offset
  2109.   Data 0,-17
  2110.   Data 7,-15
  2111.   Data 11,-12
  2112.   Data 13,-6
  2113.  
  2114.   Data 15,0
  2115.   Data 12,4
  2116.   Data 10,7
  2117.   Data 6,10
  2118.  
  2119.   Data 0,10
  2120.   Data -6,10
  2121.   Data -10,7
  2122.   Data -12,4
  2123.  
  2124.   Data -15,0
  2125.   Data -13,-6
  2126.   Data -11,-12
  2127.   Data -7,-15
  2128.  
  2129. guydata3:
  2130.   Data 0,-2         ; xt,yt        ; top shape offset
  2131.   Data 1            ; tpoint       ; rotation frame number
  2132.   Data 83           ; tstill       ; top still number
  2133.   Data 33           ; tshape       ; top shape number
  2134.   Data 33           ; tfirst       ; first shape of rotation
  2135.   Data 48           ; tlast        ; last shape of rotation
  2136.  
  2137.   Data 0            ; suck         ; suction state
  2138.   Data 0            ; stuck        ; if ball is stuck on gun
  2139.  
  2140.   Data 0,-7         ; xb,yb        ; bottom shape offset
  2141.   Data 158          ; bstill       ; bottom still number
  2142.   Data 158          ; bshape       ; bottom shape number
  2143.   Data 100          ; bfirstr      ; first shape of running right
  2144.   Data 106          ; blastr       ; last shape of running right
  2145.   Data 135          ; bfirstl      ; first shape of running left
  2146.   Data 141          ; blastl       ; last shape of running left
  2147.  
  2148.   Data 5            ; movspd       ; movement speed
  2149.  
  2150.                                    ; gun x,y offset
  2151.   Data 0,-17
  2152.   Data 7,-14
  2153.   Data 9,-12
  2154.   Data 11,-6
  2155.  
  2156.   Data 12,0
  2157.   Data 12,4
  2158.   Data 9,8
  2159.   Data 6,10
  2160.  
  2161.   Data 0,10
  2162.   Data -6,10
  2163.   Data -9,8
  2164.   Data -12,4
  2165.  
  2166.   Data -12,0
  2167.   Data -11,-6
  2168.   Data -9,-12
  2169.   Data -7,-14
  2170.  
  2171. guydata4:
  2172.   Data 0,-3         ; xt,yt        ; top shape offset
  2173.   Data 1            ; tpoint       ; rotation frame number
  2174.   Data 84           ; tstill       ; top still number
  2175.   Data 49           ; tshape       ; top shape number
  2176.   Data 49           ; tfirst       ; first shape of rotation
  2177.   Data 64           ; tlast        ; last shape of rotation
  2178.  
  2179.   Data 0            ; suck         ; suction state
  2180.   Data 0            ; stuck        ; if ball is stuck on gun
  2181.  
  2182.   Data 0,5          ; xb,yb        ; bottom shape offset
  2183.   Data 159          ; bstill       ; bottom still number
  2184.   Data 159          ; bshape       ; bottom shape number
  2185.   Data 107          ; bfirstr      ; first shape of running right
  2186.   Data 113          ; blastr       ; last shape of running right
  2187.   Data 142          ; bfirstl      ; first shape of running left
  2188.   Data 148          ; blastl       ; last shape of running left
  2189.  
  2190.   Data 6            ; movspd       ; movement speed
  2191.  
  2192.                                    ; gun x,y offset
  2193.   Data 0,-14
  2194.   Data 5,-13
  2195.   Data 7,-10
  2196.   Data 9,-7
  2197.  
  2198.   Data 11,-3
  2199.   Data 10,2
  2200.   Data 7,4
  2201.   Data 6,7
  2202.  
  2203.   Data 0,10
  2204.   Data -6,7
  2205.   Data -7,4
  2206.   Data -10,2
  2207.  
  2208.   Data -11,-3
  2209.   Data -9,-7
  2210.   Data -7,-10
  2211.   Data -5,-13
  2212.  
  2213. guydata5:
  2214.   Data 0,-8        ; xt,yt        ; top shape offset
  2215.   Data 1            ; tpoint       ; rotation frame number
  2216.   Data 85           ; tstill       ; top still number
  2217.   Data 65           ; tshape       ; top shape number
  2218.   Data 65           ; tfirst       ; first shape of rotation
  2219.   Data 80           ; tlast        ; last shape of rotation
  2220.  
  2221.   Data 0            ; suck         ; suction state
  2222.   Data 0            ; stuck        ; if ball is stuck on gun
  2223.  
  2224.   Data 0,5          ; xb,yb        ; bottom shape offset
  2225.   Data 160          ; bstill       ; bottom still number
  2226.   Data 160          ; bshape       ; bottom shape number
  2227.   Data 114          ; bfirstr      ; first shape of running right
  2228.   Data 120          ; blastr       ; last shape of running right
  2229.   Data 149          ; bfirstl      ; first shape of running left
  2230.   Data 155          ; blastl       ; last shape of running left
  2231.  
  2232.   Data 4            ; movspd       ; movement speed
  2233.  
  2234.                                    ; gun x,y offset
  2235.   Data 0,-25
  2236.   Data 8,-22
  2237.   Data 13,-16
  2238.   Data 15,-12
  2239.  
  2240.   Data 19,-4
  2241.   Data 18,1
  2242.   Data 16,5
  2243.   Data 8,8
  2244.  
  2245.   Data 0,10
  2246.   Data -8,8
  2247.   Data -16,5
  2248.   Data -18,1
  2249.  
  2250.   Data -19,-4
  2251.   Data -15,-12
  2252.   Data -13,-16
  2253.   Data -8,-22
  2254.  
  2255. Data.s "$VER:HotShots V1.29 By Chris Nash of Calm C1999"
  2256. Data.s "HotShots and HotShots related files are copyright by Chris Nash of Calm (caffeinated arcane living machine) in 1999"
  2257.  
  2258.  
  2259.  
  2260.